<%@ page import="com.example.domain.User" %><%--
  Created by IntelliJ IDEA.
  User: liuqing
  Date: 2024/10/23
  Time: 22:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
    <title>小说管理系统</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/fontawesome.min.css">
    <script src="js/jquery-3.7.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
    <link rel="stylesheet" href="css/content.css">
    <link rel="stylesheet" href="css/lunbo.css">
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <img src="img/logoniao.png" style="width: 80%;
    margin-top: 8px;">
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active-1"><a href="index.jsp">首页 <span class="sr-only">(current)</span></a></li>
                <li><a href="NovelSellServlet">热销榜</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">分类<span class="caret"></span></a>
                    <ul class="dropdown-menu" style="height: 150px;">
                        <li><a href="NovelTypeServlet?category=<%="玄幻"%>">玄幻</a></li>
                        <li><a href="NovelTypeServlet?category=<%="武侠"%>">武侠</a></li>
                        <li><a href="NovelTypeServlet?category=<%="都市"%>">都市</a></li>
                        <li><a href="NovelTypeServlet?category=<%="言情"%>">言情</a></li>
                        <li><a href="NovelTypeServlet?category=<%="历史"%>">历史</a></li>
                        <li><a href="NovelTypeServlet?category=<%="网游"%>">网游</a></li>
                        <li><a href="NovelTypeServlet?category=<%="科幻"%>">科幻</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left" action="NovelSearchServlet">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search" name="keyword" required>
                </div>
                <button type="submit" class="btn btn-default">搜 索</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="BookShelfListServlet">书架</a></li>
                <li class="dropdown-1">
                    <a href="#"><i class="fa-solid fa-bars"></i></a>
                    <ul class="dropdown-1-menu">
                        <li><a href="userInfo.jsp">个人信息</a></li>
                        <li><a href="userNovelAdd.jsp">小说添加</a></li>
                        <li><a href="UserLoginoutServlet">退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div>
</nav>
<%
    User user = (User) session.getAttribute("user");
    if (user==null){
%>
<script type="text/javascript">
    alert("请先登录！");
    window.location.href="login.jsp";
</script>
<%
    }
%>
